package bil;

import bil.gui.SplashScreen;
import javax.swing.UIManager;

/**
 *
 * @author Eduardo Folly
 */
public class Main {

    public static void main(String[] args) {
        Config config = Config.getInstance(".bil");
        setSystemLAF();

        try {
            SplashScreen.splash("/bil/gui/imagens/bil.png");
            Thread.sleep(config.getSplashTime());

            //ERRO Problema na persistencia do boleano.
            if (Config.haveQuaqua() && config.isQuaquaEnabled()) {
                try {
                    System.setProperty("Quaqua.tabLayoutPolicy", "wrap");
                    System.setProperty("Quaqua.design", "tiger");
                    System.setProperty("Quaqua.selectionStyle", "bright");
                    System.setProperty("Quaqua.opaque", "true");
                    UIManager.setLookAndFeel(ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel());
                } catch (Throwable e) {
                    setSystemLAF();
                }
            }

            SplashScreen.invokeMain("bil.gui.Principal", args);
            SplashScreen.disposeSplash();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    private static void setSystemLAF() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e1) {
            e1.printStackTrace();
        }
    }
}
